package servicio;

import java.util.List;

import interfazdao.IGarantiaDAO;


import modelo.Garantia;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class SGarantia {
	
	@Autowired
	private IGarantiaDAO interfaceGarantia;
	
	public void guardar(Garantia garantia) {
		interfaceGarantia.save(garantia);
	}

	
	public Garantia buscarGarantia(long id) {
		return interfaceGarantia.findOne(id);
	}
	
	public List<Garantia> buscarActivos() {
		List<Garantia> garantias;
		garantias = interfaceGarantia.findByEstatusTrue();
		return garantias;
	}

}
